<script type="text/javascript" src="/static/vendor/edit/ueditor.config.js?v=<?=env('version')?>"></script>
<script type="text/javascript" src="/static/vendor/edit/ueditor.all.js?v=<?=env('version')?>"></script>
<div style="padding: 15px;">
  <form class="layui-form" action="<?=url('admin/edit')?>">
    <inut type="hidden" name="id" value="<?=$info['id']?>" />
    <div class="layui-form-item">
      <label class="layui-form-label">单页标题</label>
      <div class="layui-input-inline">
        <input type="text" name="title" required  lay-verify="required" value="<?=$info['title']?>" placeholder="请输入单页标题" autocomplete="off" class="layui-input">
      </div>
      <div class="layui-form-mid layui-word-aux">例如:今磨房五谷养生招商</div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">分享描述</label>
      <div class="layui-input-block">
        <textarea name="description" placeholder="请输入分享描述" class="layui-textarea"><?=$info['description']?></textarea>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">封面图</label>
      <div class="layui-input-block">
          <button type="button" class="layui-btn" _url="<?=url('bbs/api/upimg')?>" id="myupimg">
            <i class="layui-icon">&#xe67c;</i>封面图
          </button>
          <input type="hidden" name="pic" value="<?=$info['pic']?>" />
          <div style="display:inline-block;position:relative;">
              <span style="position:absolute;right:-15px; top:-15px;cursor:pointer;color:#ccc;font-size:24px;<?php if(!$info['pic']):?>display:none;<?php endif;?>" id="closeimg">x</span>
              <img id="pic" height=50 src="<?=$info['pic']?>" />
          </div>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label"></label>
      <div class="layui-input-block">
          <div class="layui-form-mid layui-word-aux">单页内容, 会按多图顺序排列,然后再是编辑器内容.</div>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">上传多图</label>
      <div class="layui-input-block">
          <div class="layui-upload">
                <button type="button" class="layui-btn" _url="<?=url('bbs/api/upimg')?>" id="multiplepics">
                    <i class="layui-icon">&#xe67c;</i>上传多图
                </button>
                多图排序技巧, 建议一次传一张图即可按顺序排序
              <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                  预览图：
                  <div class="layui-upload-list" id="multiplepicsshow">
                    <?php foreach(explode(",",$info['pics']) as $k=>$v): ?>
                    <div style="display:inline-block;position:relative;margin-right:20px;">
                        <input type="hidden" name="pics[]" value="<?=$v?>" />
                      <span style="position:absolute;right:-15px; top:-15px;cursor:pointer;color:#ccc;font-size:24px;<?php if(!$v):?>display:none;<?php endif;?>" onclick="closeimg(this)">x</span>
                      <img height=100 src="<?=$v?>" />
                    </div>
                    <?php endforeach;?>
                  </div>
              </blockquote>
          </div>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">内容</label>
      <div class="layui-input-block">
          <script id="container" name="content" type="text/plain"><?=htmlspecialchars_decode($info['content'])?></script>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">留言</label>
      <div class="layui-input-block">
          <input type="checkbox" <?php if(!$info['is_message']):?>checked=""<?php endif;?> name="is_message" lay-skin="switch" lay-filter="switchTest" lay-text="开|关">
      </div>
    </div>
        <div class="layui-form-item">
          <div class="layui-input-block">
            <button class="layui-btn"  lay-submit lay-filter="myform">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
          </div>
        </div>
  </form>
</div>
<script>
layui.use(['form', 'upload'], function(){
  var $ = layui.$
  ,upload = layui.upload
  ,form = layui.form;
  form.render();
  var ue = UE.getEditor('container');
});
</script>
